<?php
/*
 * Created on 2013-1-26
 *
 */
include dirname(__FILE__)."/../../conf/config.ini.php";
class BaseDAO{
	private $mysqli_conn = null;
	public function __construct(){
		global $db_host, $db_user_name, $db_user_password, $db_database_name;
		$this->mysqli_conn = new mysqli($db_host, $db_user_name, $db_user_password, $db_database_name) or die("echo '数据库连接错误';exit();");
	}
	public function getConn(){				
		$this->mysqli_conn->query("set names 'utf8'");
		return $this->mysqli_conn;
	}
	public function getStmt(){
		return $this->getConn()->stmt_init();
	}
	public function __destruct(){
		if($this->mysqli_conn != null)
			$this->mysqli_conn->close();
		$this->mysqli_conn = null;
	}
}
?>